<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>AdminLTE 2 | Dashboard</title>
        <!-- Tell the browser to be responsive to screen width -->
        <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
        <!-- Bootstrap 3.3.6 -->
        <link rel="stylesheet" href="/Public/ui/framework/bootstrap-3.3.7-dist/css/bootstrap.min.css" />
        <!-- Font Awesome -->
        <link rel="stylesheet" href="/Public/ui/fonts/Font-Awesome-4.7.0/css/font-awesome.min.css" />
        <!-- Ionicons -->
        <link rel="stylesheet" href="/Public/ui/fonts/ionicons-2.0.1/css/ionicons.min.css" />
        <!-- TreeGrid 0.3.0 -->
        <link rel="stylesheet" href="/Public/ui/plugins/treegridlib/jquery-treegrid-0.3.0/css/jquery.treegrid.css" />
        <!-- Theme style -->
        <link rel="stylesheet" href="/Public/ui/adminlte/css/AdminLTE.min.css" />
        <!-- AdminLTE Skins. Choose a skin from the css/skins
             folder instead of downloading all of them to reduce the load. -->
        <link rel="stylesheet" href="/Public/ui/adminlte/css/skins/_all-skins.min.css" />
        
    </head>
    <body>
        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper" style="margin:0;">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                
<h1>
    导航菜单
    <small>advanced tables</small>
</h1>
<ol class="breadcrumb">
    <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
    <li><a href="#">内容</a></li>
    <li class="active">导航菜单</li>
</ol>

            </section>

            <!-- Main content -->
            <section class="content">
                <div class="row">
                    <div class="col-xs-12">
                        
<div class="box">
    <div class="box-header">
        <div class="row">
            <div class="col-md-5">
                <button type="button" class="btn btn-default navbar-btn xsui-btn-add-dialog" data-url="<?php echo U('edit');?>" title="新增导航菜单">新增</button>
                <button type="button" class="btn btn-danger navbar-btn xsui-btn-multi-delete" data-url="<?php echo U('delete','id=varkey');?>">批量删除</button>
                <button type="button" class="btn btn-success navbar-btn xsui-btn-refresh">刷新</button>
            </div>
            <div class="col-md-7">
                <form class="navbar-form navbar-right">
                    <div class="form-group">
                        <input type="text" name="word" class="form-control" placeholder="关键词..." title="名称、代码" value="<?php echo ($search["word"]); ?>" />
                    </div>
                    <button type="submit" class="btn btn-default">搜索</button>
                </form>
            </div>
        </div>
    </div>
    <!-- /.box-header -->
    <div class="box-body">
        <table class="xsui-treegrid table table-condensed table-bordered table-striped table-hover">
            <thead>
                <tr>
                    <th><input type="checkbox" class="xsui-btn-checking-all" /></th>
                    <th>#</th>
                    <th>菜单名称</th>
                    <th>代码</th>
                    <th>链接</th>
                    <th>打开目标</th>
                    <th>排序</th>
                    <th>前台显示</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <?php if(is_array($tree)): foreach($tree as $key=>$vo): ?><tr class="treegrid-1" data-key="<?php echo ($vo["id"]); ?>">
                    <td><input type="checkbox" value="<?php echo ($vo["id"]); ?>" /></td>
                    <td title="<?php echo ($vo["id"]); ?>"></td>
                    <td title="<?php echo ($vo["id"]); ?>|<?php echo ($vo["title"]); ?>"><a href="<?php echo U('edit','id='.$vo['id']);?>" class="xsui-btn-edit-dialog" data-id="<?php echo ($vo["id"]); ?>" title="编辑 <?php echo ($vo["title"]); ?>"><?php echo xsfn_msubstr($vo['title'],0,30);?></a></td>
                    <td><?php echo ($vo["code"]); ?></td>
                    <td><?php echo ($vo["link_url"]); ?></td>
                    <td><?php echo ($vo["open_target"]); ?></td>
                    <td class="xsui-cell-sort"><input type="text" value="<?php echo ($vo["sort"]); ?>" size="3" data-value="<?php echo ($vo["sort"]); ?>" data-url="<?php echo U('changeSort','id='.$vo['id'].'&sort=varsort');?>" title="更改后,鼠标点击页面任意位置即可自动生效" /></td>
                    <td class="xsui-cell-status"><a href="<?php echo U('changeStatus','id='.$vo['id'].'&status=varstatus');?>" data-value="<?php echo ($vo["status"]); ?>" title="点击隐藏" class="text-success"><i class="fa fa-check fa-fw"></i></a></td>
                    <td><?php echo ($vo["create_time"]); ?></td>
                    <td class="xsui-action-td">
                        <div class="btn-group">
                            <a class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" href="#">
                                操作
                                <span class="caret"></span>
                            </a>
                            <ul class="dropdown-menu pull-right" style="min-width: 60px">
                                <li><a href="<?php echo U('edit','pid='.$vo['id']);?>" class="xsui-btn-edit-dialog" title="新增子导航菜单 - <?php echo ($vo["title"]); ?>"><i class="glyphicon glyphicon-plus"></i>添加</a></li>
                                <li><a href="<?php echo U('edit','id='.$vo['id']);?>" class="xsui-btn-edit-dialog" title="编辑 <?php echo ($vo['title']); ?>"><span class="glyphicon glyphicon-edit"></span>编辑</a></li>
                                <li><a href="<?php echo U('delete','id='.$vo['id']);?>" class="xsui-btn-delete" title="删除 <?php echo ($vo['title']); ?>"><span class="glyphicon glyphicon-remove"></span>删除</a></li>
                            </ul>
                        </div>
                    </td>
                </tr>
                <?php if(is_array($vo['children'])): foreach($vo['children'] as $key=>$vo2): ?><tr class="treegrid-2  treegrid-parent-1" data-key="<?php echo ($vo2["id"]); ?>">
                    <td><input type="checkbox" value="<?php echo ($vo2["id"]); ?>" /></td>
                    <td title="<?php echo ($vo2["id"]); ?>"></td>
                    <td title="<?php echo ($vo2["id"]); ?>|<?php echo ($vo2["title"]); ?>"><a href="<?php echo U('edit','id='.$vo2['id']);?>" class="xsui-btn-edit-dialog" data-id="<?php echo ($vo2["id"]); ?>" title="编辑 <?php echo ($vo2["title"]); ?>"><?php echo xsfn_msubstr($vo2['title'],0,30);?></a></td>
                    <td><?php echo ($vo2["code"]); ?></td>
                    <td><?php echo ($vo2["link_url"]); ?></td>
                    <td><?php echo ($vo2["open_target"]); ?></td>
                    <td class="xsui-cell-sort"><input type="text" value="<?php echo ($vo2["sort"]); ?>" size="3" data-value="<?php echo ($vo2["sort"]); ?>" data-url="<?php echo U('changeSort','id='.$vo2['id'].'&sort=varsort');?>" title="更改后,鼠标点击页面任意位置即可自动生效" /></td>
                    <td class="xsui-cell-status"><a href="<?php echo U('changeStatus','id='.$vo2['id'].'&status=varstatus');?>" data-value="<?php echo ($vo2["status"]); ?>" title="点击隐藏" class="xsui-success"><i class="fa fa-check fa-fw"></i></a></td>
                    <td><?php echo ($vo2["create_time"]); ?></td>
                    <td class="xsui-action-td">
                        <div class="btn-group">
                            <a class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" href="#">
                                操作
                                <span class="caret"></span>
                            </a>
                            <ul class="dropdown-menu pull-right" style="min-width: 60px">
                                <li><a href="<?php echo U('edit','pid='.$vo2['id']);?>" class="xsui-btn-edit-dialog" title="新增子导航菜单 - <?php echo ($vo2["title"]); ?>"><i class="glyphicon glyphicon-plus"></i>添加</a></li>
                                <li><a href="<?php echo U('edit','id='.$vo2['id']);?>" class="xsui-btn-edit-dialog" title="编辑 <?php echo ($vo2['title']); ?>"><span class="glyphicon glyphicon-edit"></span>编辑</a></li>
                                <li><a href="<?php echo U('delete','id='.$vo2['id']);?>" class="xsui-btn-delete" title="删除 <?php echo ($vo2['title']); ?>"><span class="glyphicon glyphicon-remove"></span>删除</a></li>
                            </ul>
                        </div>
                    </td>
                </tr>
                <?php if(is_array($vo2['children'])): foreach($vo2['children'] as $key=>$vo3): ?><tr class="treegrid-3  treegrid-parent-2" data-key="<?php echo ($vo3["id"]); ?>">
                    <td><input type="checkbox" value="<?php echo ($vo3["id"]); ?>" /></td>
                    <td title="<?php echo ($vo3["id"]); ?>"></td>
                    <td title="<?php echo ($vo3["id"]); ?>|<?php echo ($vo3["title"]); ?>"><a href="<?php echo U('edit','id='.$vo3['id']);?>" class="xsui-btn-edit-dialog" data-id="<?php echo ($vo3["id"]); ?>" title="编辑 <?php echo ($vo3["title"]); ?>"><?php echo xsfn_msubstr($vo3['title'],0,30);?></a></td>
                    <td><?php echo ($vo3["code"]); ?></td>
                    <td><?php echo ($vo3["link_url"]); ?></td>
                    <td><?php echo ($vo3["open_target"]); ?></td>
                    <td class="xsui-cell-sort"><input type="text" value="<?php echo ($vo3["sort"]); ?>" size="3" data-value="<?php echo ($vo3["sort"]); ?>" data-url="<?php echo U('changeSort','id='.$vo3['id'].'&sort=varsort');?>" title="更改后,鼠标点击页面任意位置即可自动生效" /></td>
                    <td class="xsui-cell-status"><a href="<?php echo U('changeStatus','id='.$vo3['id'].'&status=varstatus');?>" data-value="<?php echo ($vo3["status"]); ?>" title="点击隐藏" class="xsui-success"><i class="fa fa-check fa-fw"></i></a></td>
                    <td><?php echo ($vo3["create_time"]); ?></td>
                    <td class="xsui-action-td">
                        <div class="btn-group">
                            <a class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" href="#">
                                操作
                                <span class="caret"></span>
                            </a>
                            <ul class="dropdown-menu pull-right" style="min-width: 60px">
                                <li><a href="<?php echo U('edit','pid='.$vo3['id']);?>" class="xsui-btn-edit-dialog" title="新增子导航菜单 - <?php echo ($vo3["title"]); ?>"><i class="glyphicon glyphicon-plus"></i>添加</a></li>
                                <li><a href="<?php echo U('edit','id='.$vo3['id']);?>" class="xsui-btn-edit-dialog" title="编辑 <?php echo ($vo3['title']); ?>"><span class="glyphicon glyphicon-edit"></span>编辑</a></li>
                                <li><a href="<?php echo U('delete','id='.$vo3['id']);?>" class="xsui-btn-delete" title="删除 <?php echo ($vo3['title']); ?>"><span class="glyphicon glyphicon-remove"></span>删除</a></li>
                            </ul>
                        </div>
                    </td>
                </tr><?php endforeach; endif; endforeach; endif; endforeach; endif; ?>
            </tbody>
        </table>
    </div>
    <!-- /.box-body -->
</div>
<!-- /.box -->

                        <!-- /.box -->
                    </div>
                    <!-- /.col -->
                </div>
                <!-- /.row -->
            </section>
            <!-- /.content -->
        </div>
        <!-- /.content-wrapper -->

        <!-- jQuery 2.2.3 -->
        <script src="/Public/ui/plugins/jQuery/jquery-2.2.3.min.js"></script>
        <!-- Bootstrap 3.3.6 -->
        <script src="/Public/ui/framework/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
        <!-- Treegrid 0.3.0 -->
        <script src="/Public/ui/plugins/treegridlib/jquery-treegrid-0.3.0/js/jquery.treegrid.min.js"></script>
        <script src="/Public/ui/plugins/treegridlib/jquery-treegrid-0.3.0/js/jquery.treegrid.bootstrap3.js"></script>
        <!-- Layer 3.0.1 -->
        <script src="/Public/ui/plugins/dialoglib/layer-v3.0.1/layer.js"></script>
        <script src="/Public/theme/public/plugins/jquery-togglelink-1.0/jquery-togglelink-1.0.js"></script>
        <script src="/Public/theme/public/plugins/jquery-ajaxcombobox-1.0/jquery-ajaxcombobox-1.0.js"></script>
        <script src="/Public/ui/adminlte/js/xsApp.js"></script>

        
        
<script>
    // 2017-3-18
    $('.xsui-btn-process').click(function () {
        $.get($(this).data('url'), function () {
            alert('同步成功!');
        })
        return false;
    })
</script>

        
        <!-- page script -->
        <script type="text/javascript">
            $(function () {
                xsApp.initTreegridPage();
            });
        </script>
        
        
    </body>
</html>